// Copyright 2025 CCC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and

import { Navigate } from 'react-router-dom';
import { SmileFilled, HomeFilled } from '@ant-design/icons';

import { RouteType } from '.';

import App from '@/App';
import Home from '@/pages/Home';
import Login from '@/pages/Login';
import ForgetPassword from '@/pages/forgetPassword';
import Register from '@/pages/register';
import ErrorPage from '@/ErrorPage';

export const routers = [
  {
    path: '/',
    /**重定向 */
    element: <Navigate replace to="/home" />,
  },
  {
    path: '/',
    /** 承载布局 */
    element: <App />,
    errorElement: <ErrorPage />,
    icon: <SmileFilled />,
    children: [
      {
        path: '/home',
        name: '首页',
        icon: <HomeFilled />,
        element: <Home />,
        permissionObj: true,
      },
    ],
  },
  {
    path: '/login',
    name: '登录',
    element: <Login />,
  },
  {
    path: '/register',
    name: '注册',
    element: <Register />,
  },
  {
    path: '/forgotPassword',
    name: '找回密码',
    element: <ForgetPassword />,
  },
] as RouteType[];
